home *** CD-ROM | disk | FTP | other *** search
- Path: newsroom.hitc.com!usenet
- From: psand@eos.hitc.com (G. Patrick Sand)
- Newsgroups: comp.lang.c++
- Subject: Re: newbie ? on inheritance in VC++
- Date: 11 Jan 1996 21:07:44 GMT
- Organization: Hughes Aircraft (EOSDIS)
- Message-ID: <4d3u70$6bh@newsroom.hitc.com>
- References: <30F46027.15FB@cell.cinvestav.mx>
- NNTP-Posting-Host: 155.157.118.56
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- In article <30F46027.15FB@cell.cinvestav.mx>, hhemken@cell.cinvestav.mx
- says...
-
- >= = = = = = = = = = Code Fragment = = = = = = = = = = = = = = = = = =
- >
- >class C_Item
- >{
- > protected:
- > C_Item *Previous; // address of previous C_Item
- > C_Item *Next; // address of next C_Item
- > public:
- > C_Item();
- > ~C_Item();
- > C_Item *Attach(C_Item *ItemPointer);
- > C_Item *Detach(void);
- >};
- >// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- >// C_List is the base class of a C_List of listable items derived from
- >C_Item
- >
- >class C_List : public C_Item
- >{
- > private:
- > C_Item *ListHead; // C_List head
- > C_Item *CurrentItem; // Current C_Item
- >
- (Rest deleted for brevity)
-
- You appear to be using both inheritence (...: public C_Item...) and
- membership (...private: CItem *...). I suggest you drop the inheritence
- and try again.
-
- --
- G. Patrick Sand
- psand@eos.hitc.com
- PatSand@aol.com
- (301) 925-0791
- "Travel Light But Right..."
- Microsoft Network is prohibited from redistributing
- this work in any form, in whole or in part. License
- to distribute this individual post is available to Microsoft
- for $999. Posting without permission constitutes an
- agreement to these terms...gps
-
-